package dhy.com.Test;

import dhy.com.anno.EnableRpcMain;
import dhy.com.client.RpcClientManagerImpl;



/**
 * @author 大忽悠
 * @create 2022/1/25 20:10
 */
@EnableRpcMain
public class ClientMain
{
    public static void main(String[] args) {
        RpcClientManagerImpl rpcClientManager = new RpcClientManagerImpl();
        rpcClientManager.startRPC();
        Class<dhy.com.Test.Service.ClientService> serviceClass = dhy.com.Test.Service.ClientService.class;
        dhy.com.Test.Service.ClientService service = (dhy.com.Test.Service.ClientService) rpcClientManager.getProxyService(serviceClass);
        String name = service.getName();
        System.out.println("name为: "+name);
        String hello = service.sayHello();
        System.out.println("hello为: "+hello);
    }
}
